
// smoothed buffer
VIS.Smoothed = {};

VIS.Settings = {

	{ "test_string", "hello world!", MXSETTING_STRING },
	{ "test_int", 2, MXSETTING_NUM, { Min = 1, Max = 5, Dec = 0 } },
	{ "test_bool", true, MXSETTING_BOOL }

};

/*------------------------------------
	Init
------------------------------------*/
function VIS:Init( )

end

/*------------------------------------
	Render
------------------------------------*/
function VIS:Render( panel, position, duration )

	// measure
	surface.SetFont( "DefaultSmall" );
	local w, h = surface.GetTextSize( "A" );
	
	// background
	draw.RoundedBox(
		4,
		5, 5,
		128, h * 2 + 10,
		Color( 0, 184, 253, 40 )
	
	);

	draw.SimpleText(
		"Position: " .. position,
		"DefaultSmall",
		10, 10,
		Color( 255, 255, 255, 255 ),
		TEXT_ALIGN_LEFT,
		TEXT_ALIGN_TOP
	
	);
	draw.SimpleText(
		"Duration: " .. duration,
		"DefaultSmall",
		10, 10 + h,
		Color( 255, 255, 255, 255 ),
		TEXT_ALIGN_LEFT,
		TEXT_ALIGN_TOP
	
	);
	
	local w, h = panel:GetSize();
	local alertw, alerth = w * 0.5, h * 0.25;
	
	// alert box
	draw.RoundedBox(
		4,
		( w * 0.5 ) - ( alertw * 0.5 ), ( h * 0.5 ) - ( alerth * 0.5 ),
		alertw, alerth,
		Color( 200, 200, 200, 40 )
	
	);
	
	// draw warning
	draw.SimpleText(
		"Work in Progress",
		"Default",
		w * 0.5, h * 0.5,
		Color( 255, 255, 255, 255 ),
		TEXT_ALIGN_CENTER,
		TEXT_ALIGN_CENTER
	
	);

end

/*------------------------------------
	Think
------------------------------------*/
function VIS:Think( sample, position, duration )

end

// register
MuseX.DefineVisualization( "MX Debug", VIS );
